#ifndef __AUTH_MANAGER_H__
#define __AUTH_MANAGER_H__

#include "manager_list.h"

#define AUTH_LIST_LEN 16
#define GET_AUTH_LIST_KEY(ADDR) (ADDR & 0xF)

typedef struct
{
    unsigned int dev_id;
    unsigned int is_online;
    unsigned int alive_tick; /**< 保活tick */
} gateway_auth_node_t;

manager_list_t *get_auth_list(void);

int manager_init_auth(void);

int manager_check_key(char *key);

int manager_auth_list_is_empty(void);

int manager_add_trust_dev(unsigned int dev_id);

int manager_del_trust_dev(unsigned int dev_id);

int manager_query_trust_dev(unsigned int dev_id);

void manager_clean_trust_dev(void);

void manager_mark_dev_offline(unsigned int user_id);

#endif /* __AUTH_MANAGER_H__ */
